home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
58189
/
58189.xpi
/
chrome
/
content
/
statusbar.js
< prev
next >
Wrap
Text File
|
2010-01-06
|
2KB
|
64 lines
/*
* This class provides the functions required by the status bar. These include
* recording feedback and enabling/disabling the policy decisions.
*/
Components.utils.import("resource://csfiremodules/CsFireCommon.jsm");
CsFire.StatusBar = new function() {
this.window = null;
};
/*
* This function makes sure the menu is shown when the statusbar is clicked
*/
CsFire.StatusBar.onPanelClick = function() {
try {
var anchor = document.getElementById("csfirePanel");
document.getElementById("csfireStatusMenu").openPopup(anchor, "before_start", 0, 0, true, false);
}
catch(ex) { }
}
/*
* This function handles a click on the whitelist button
*/
CsFire.StatusBar.onWhitelistClick = function() {
this.window = window.open("chrome://csfire/content/whitelist.xul", "CsFire Whitelist", "chrome");
}
/*
* This function initializes the loading, by setting the policy status variables
* and status bar icons
*/
CsFire.StatusBar.onActivateLoad = function() {
var active = CsFire.PolicyManager.isEnabled();
// Retrieve the XUL element
var element = document.getElementById("csfirePanel");
if(active) {
element.label = "CsFire";
element.tooltip = "CsFire Protection Enabled";
var style = element.style;
style['color'] = "green";
}
else {
element.label = "CsFire";
element.tooltip = "CsFire Protection Disabled";
var style = element.style;
style['color'] = "red";
}
}
/*
* This function switches the status of the policy (enabled/disabled)
*/
CsFire.StatusBar.onActivateClick = function() {
CsFire.PolicyManager.switchEnabledStatus();
this.onActivateLoad();
}
//Set the statusbar field
window.addEventListener("load", function(e) { CsFire.StatusBar.onActivateLoad(); }, false);